﻿namespace xWF.Examples.Tkmv
{
    public class TkmvState : IWorkflowState<TkmvWorkItem>
    {
        public TkmvState(TkmvStatus status)
        {
            this.status = status;
        }

        public void OnEnter(TkmvWorkItem workItem) {}

        public void OnExit(TkmvWorkItem workItem) {}

        public override int GetHashCode()
        {
            return status.GetHashCode();
        }

        public override bool Equals(object obj)
        {
            var other = obj as TkmvState;
            return other != null && Equals(other);
        }

        protected bool Equals(TkmvState other)
        {
            return status.Equals(other.status);
        }

        private readonly TkmvStatus status;
    }
}
